package NC;

public class NC81 {
    private int index =0;
    TreeNode KthNode(TreeNode pRoot, int k){
        if(pRoot==null) return null;
        TreeNode node= KthNode(pRoot.left,k);
        if(node!=null) return node;
        index++;
        if(k==index) return pRoot;
        node = KthNode(pRoot.right,k);
        if(node!=null) return node;
        return null;
    }
}